local pohuai = fk.CreateSkill {
  name = "th_pohuai",
  tags = { Skill.Compulsory },
}

pohuai:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(pohuai.name) and
    data.card and data.card.is_damage_card and data.to ~= player
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = data.to
    local judge = {
      who = player,
      reason = pohuai.name,
      pattern = ".",
    }
    room:judge(judge)
    if not judge.card then return end
    local type = ({"basic", "trick", "equip"})[judge.card.type]
    local discard = Util.DummyTable
    if not (to:isKongcheng() or (to:isNude() and type == "equip")) then
      discard = room:askToDiscard(to, {
        min_num = 1,
        max_num = 1,
        include_equip = true,
        skill_name = pohuai.name,
        cancelable = false,
        pattern = ".|.|.|.|.|" .. type,
        prompt = "#th_pohuai-ask:::" .. type
      })
    end
    if #discard == 0 then
      room:damage{
        from = player,
        to = to,
        damage = 1,
        skillName = pohuai.name,
      }
    end
  end,
})

Fk:loadTranslationTable{
  ["th_pohuai"] = "破坏",
  [":th_pohuai"] = "锁定技，你使用伤害牌指定其他角色为目标后，你判定：目标须弃置一张与判定结果类别相同的牌，若无牌可弃，你对其造成1点伤害。",

  ["#th_pohuai-ask"] = "破坏：你须弃置一张%arg",
}

return pohuai